//
//  RDRequest.swift
//  test-ios
//
//  Created by wyz5204 on 2023/6/1.
//

import Foundation

struct RDRequest<T: Codable>: Codable {
    let token: String
    let userId : Int
    let projectId : Int
    let loginType : String
    let data: T?
    
    enum Coding: String, CodingKey {
        case token
        case userId
        case projectId
        case loginType
        case data
    }
    
    init(token: String , userId : Int , projectId : Int , loginType : String ,data: T){
        self.token = token
        self.userId = userId
        self.projectId = projectId
        self.loginType = loginType
        self.data = data
    }
    
    init(data: T){
        self.init(token: "", userId: -1, projectId: -1, loginType: "ios", data: data)
    }
}
